package com.lagou;

import com.lagou.boot.RpcProvide;
import com.lagou.boot.SpringContextHolder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class RpcProvideApplication02 {
    public static void main(String[] args) {

        SpringApplication.run(RpcProvideApplication02.class, args);
    }
    public final static int port = 9000;
    @Bean
    public void run() throws Exception {
        //启动服务器
        RpcProvide.startServer("127.0.0.1",port);
    }

    @Bean
    public SpringContextHolder  springContextHolder(){
        return  new SpringContextHolder();
    }
}
